function toggleGridOpts() {
    var gridOptFields = [
        "id_grid_color"
        ,"id_plot_grid_tick_scale"
        ,"id_plot_grid_label_scale"
    ];
    var showGrid = document.getElementById("id_show_grid").checked;
    for(i = 0; i < gridOptFields.length; i++) {
        document.getElementById(gridOptFields[i]).disabled = !showGrid;
    }
}
